﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace wallet
{
    public partial class wallet_recharge : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            AjaxPro.Utility.RegisterTypeForAjax(typeof(wallet_recharge));
        }
        [AjaxPro.AjaxMethod]
        public bool InsertOrder(string account,string amount)
        {
            //accountagain.Value;
            //session["username"]  session["userid"]
            MODEL.OrderMaster model = new MODEL.OrderMaster();
            BLL.OrderMaster bll = new BLL.OrderMaster();

            DateTime _time = DateTime.Now;
            model.OACCOUNT = account;
            model.OID = new DAL.OrderMaster().GetNewsID();
            model.OTIME = _time;
            model.OYEAR = _time.Year.ToString();
            model.OMONTH = _time.Month.ToString();
            model.ODAY = _time.Day.ToString();
            model.OAMOUNT = Convert.ToInt32(amount);
            model.OGAMEID = null;
            model.OPAYMENT = "支付宝在线支付";
            model.OCOUNT = CountNumber(Convert.ToInt32(amount));
            model.ODESCRIPTION = "网站游戏点充值";
            model.OUSERID = new BLL.UserLogon().UserLogonListByName(account).Tables[0].Rows[0]["Uid"].ToString();
            bool flag = bll.OrderMasterAdd(model);
            return flag;
        }
        [AjaxPro.AjaxMethod]
        public int CountNumber(int moneyNum)
        {
            return moneyNum * 10;
        }
        
    }
}
